<!--  -->
<template>
    <!-- 底部tabbar开始 -->
    <section class="tabbar">
      <div @click.stop="handleClick('home')" class="tabbar-item">
        <img class="tabbar-item-icon" :src="$route.path.includes('/home')?require('./images/tabbar/home_fill_light.svg'):require('./images/tabbar/home_light.svg')" alt="">
        <span :class="{on:$route.path.includes('/home')}">首页</span>
      </div>
      <div  @click="handleClick('movie')" class="tabbar-item">
        <img class="tabbar-item-icon" :src="$route.path.includes('/movie')?require('./images/tabbar/movie_fill_light.svg'):require('./images/tabbar/movie_light.svg')" alt="">
        <span :class="{on:$route.path.includes('/movie')}">电影</span>
      </div>
      <div @click="handleClick('cinema')" class="tabbar-item">
        <img class="tabbar-item-icon" :src="$route.path.includes('/cinema')?require('./images/tabbar/cinema_fill_light.svg'):require('./images/tabbar/cinema_light.svg')" alt="">
        <span :class="{on:$route.path.includes('/cinema')}">影院</span>
      </div>
      <div @click="handleClick('my')" class="tabbar-item">
        <img class="tabbar-item-icon" :src="$route.path.includes('/my')?require('./images/tabbar/my_fill_light.svg'):require('./images/tabbar/my_light.svg')" alt="">
        <span :class="{on:$route.path.includes('/my')}">我的</span>
      </div>
    </section>
    <!-- 底部tabbar结束 -->
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
//这里存放数据
return {

};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
  handleClick:function(path){
    console.log(this.$route)
    this.$router.push({
      // path:p
      path
    })
  }
},
//生命周期 - 创建完成（可以访问当前this实例）
created() {

},
//生命周期 - 挂载完成（可以访问DOM元素）
mounted() {

},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style lang='less' scoped>
     
  .on{
    color: red;
  }
  .tabbar {
    width: 100%;
    height: 1.041rem;
    position: fixed;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 999;
    display: -ms-flexbox;
    display: flex;
    background-color: #fff;
    border-top: 1px solid #f1f1f1;
  }
  .tabbar-item {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-size: .21rem;
    margin-bottom: 0.041rem;
    color: #333;
  }
  .tabbar-item-icon {
    margin-bottom: 0.041rem;
    width: 32%;
  }

  .tabbar-item-text {

  }
</style>